home *** CD-ROM | disk | FTP | other *** search
/ CICA 1995 August / CICA - The Ultimate Collection of Shareware for Windows (Disc 2) (August 1995).iso / disc2 / demo / pwrtcp11.exe / FTP.FR_ / FTP.bin
Text File  |  1994-11-13  |  17KB  |  633 lines

  1. VERSION 2.00
  2. Begin Form FTP 
  3.    Caption         =   "FTP Test"
  4.    ClientHeight    =   6750
  5.    ClientLeft      =   1095
  6.    ClientTop       =   1500
  7.    ClientWidth     =   9660
  8.    Height          =   7155
  9.    Icon            =   FTP.FRX:0000
  10.    Left            =   1035
  11.    LinkTopic       =   "Form1"
  12.    ScaleHeight     =   6750
  13.    ScaleWidth      =   9660
  14.    Top             =   1155
  15.    Width           =   9780
  16.    Begin TextBox Text3 
  17.       Height          =   2775
  18.       Left            =   3600
  19.       MultiLine       =   -1  'True
  20.       ScrollBars      =   3  'Both
  21.       TabIndex        =   48
  22.       Top             =   480
  23.       Width           =   2895
  24.    End
  25.    Begin TextBox Text1 
  26.       Height          =   2775
  27.       Left            =   6600
  28.       MultiLine       =   -1  'True
  29.       ScrollBars      =   3  'Both
  30.       TabIndex        =   47
  31.       Top             =   480
  32.       Width           =   2895
  33.    End
  34.    Begin CommandButton Command24 
  35.       Caption         =   "Misc3"
  36.       Height          =   255
  37.       Left            =   2160
  38.       TabIndex        =   45
  39.       Top             =   3000
  40.       Width           =   855
  41.    End
  42.    Begin CommandButton Command23 
  43.       Caption         =   "Misc2"
  44.       Height          =   255
  45.       Left            =   1200
  46.       TabIndex        =   44
  47.       Top             =   3000
  48.       Width           =   735
  49.    End
  50.    Begin CommandButton Command22 
  51.       Caption         =   "Misc1"
  52.       Height          =   255
  53.       Left            =   120
  54.       TabIndex        =   43
  55.       Top             =   3000
  56.       Width           =   855
  57.    End
  58.    Begin TextBox CommandStr 
  59.       Height          =   285
  60.       Left            =   1200
  61.       TabIndex        =   39
  62.       Text            =   "PWD"
  63.       Top             =   2640
  64.       Width           =   2175
  65.    End
  66.    Begin CommandButton Command18 
  67.       Caption         =   "Command"
  68.       Height          =   255
  69.       Left            =   120
  70.       TabIndex        =   38
  71.       Top             =   2640
  72.       Width           =   855
  73.    End
  74.    Begin TextBox FileSize 
  75.       Height          =   285
  76.       Left            =   1200
  77.       TabIndex        =   35
  78.       Text            =   "1024 512"
  79.       Top             =   2280
  80.       Width           =   1815
  81.    End
  82.    Begin CommandButton Command15 
  83.       Caption         =   "Allocate"
  84.       Height          =   255
  85.       Left            =   120
  86.       TabIndex        =   34
  87.       Top             =   2280
  88.       Width           =   855
  89.    End
  90.    Begin CommandButton Cle 
  91.       Caption         =   "Clear"
  92.       Height          =   255
  93.       Left            =   3720
  94.       TabIndex        =   32
  95.       Top             =   120
  96.       Width           =   735
  97.    End
  98.    Begin Frame Frame2 
  99.       Caption         =   "Data"
  100.       Height          =   2895
  101.       Left            =   120
  102.       TabIndex        =   19
  103.       Top             =   3360
  104.       Width           =   9375
  105.       Begin CommandButton Command25 
  106.          Caption         =   "RENAME"
  107.          Height          =   255
  108.          Left            =   960
  109.          TabIndex        =   46
  110.          Top             =   2520
  111.          Width           =   735
  112.       End
  113.       Begin CommandButton Command21 
  114.          Caption         =   "RMD"
  115.          Height          =   255
  116.          Left            =   120
  117.          TabIndex        =   42
  118.          Top             =   2520
  119.          Width           =   735
  120.       End
  121.       Begin CommandButton Command20 
  122.          Caption         =   "MKD"
  123.          Height          =   255
  124.          Left            =   120
  125.          TabIndex        =   41
  126.          Top             =   2160
  127.          Width           =   735
  128.       End
  129.       Begin CommandButton Command19 
  130.          Caption         =   "DELE"
  131.          Height          =   255
  132.          Left            =   2640
  133.          TabIndex        =   40
  134.          Top             =   2160
  135.          Width           =   735
  136.       End
  137.       Begin CommandButton Command17 
  138.          Caption         =   "CDUP"
  139.          Height          =   255
  140.          Left            =   960
  141.          TabIndex        =   37
  142.          Top             =   2160
  143.          Width           =   735
  144.       End
  145.       Begin CommandButton Command16 
  146.          Caption         =   "CWD"
  147.          Height          =   255
  148.          Left            =   960
  149.          TabIndex        =   36
  150.          Top             =   1800
  151.          Width           =   735
  152.       End
  153.       Begin TextBox LocalName 
  154.          Height          =   375
  155.          Left            =   1440
  156.          TabIndex        =   30
  157.          Text            =   "local.dat"
  158.          Top             =   840
  159.          Width           =   1695
  160.       End
  161.       Begin CommandButton Command13 
  162.          Caption         =   "ASCII"
  163.          Height          =   255
  164.          Left            =   120
  165.          TabIndex        =   28
  166.          Top             =   1800
  167.          Width           =   735
  168.       End
  169.       Begin CommandButton Command12 
  170.          Caption         =   "IMAGE"
  171.          Height          =   255
  172.          Left            =   120
  173.          TabIndex        =   27
  174.          Top             =   1440
  175.          Width           =   735
  176.       End
  177.       Begin CommandButton Command10 
  178.          Caption         =   "PWD"
  179.          Height          =   255
  180.          Left            =   960
  181.          TabIndex        =   25
  182.          Top             =   1440
  183.          Width           =   735
  184.       End
  185.       Begin CommandButton Command9 
  186.          Caption         =   "RETR"
  187.          Height          =   255
  188.          Left            =   1800
  189.          TabIndex        =   1
  190.          Top             =   2520
  191.          Width           =   735
  192.       End
  193.       Begin CommandButton Command8 
  194.          Caption         =   "APPE"
  195.          Height          =   255
  196.          Left            =   1800
  197.          TabIndex        =   2
  198.          Top             =   2160
  199.          Width           =   735
  200.       End
  201.       Begin CommandButton Command7 
  202.          Caption         =   "STOU"
  203.          Height          =   255
  204.          Left            =   1800
  205.          TabIndex        =   3
  206.          Top             =   1800
  207.          Width           =   735
  208.       End
  209.       Begin CommandButton Command6 
  210.          Caption         =   "STOR"
  211.          Height          =   255
  212.          Left            =   1800
  213.          TabIndex        =   8
  214.          Top             =   1440
  215.          Width           =   735
  216.       End
  217.       Begin TextBox Text2 
  218.          Height          =   2415
  219.          Left            =   3600
  220.          MultiLine       =   -1  'True
  221.          ScrollBars      =   3  'Both
  222.          TabIndex        =   24
  223.          Top             =   360
  224.          Width           =   5655
  225.       End
  226.       Begin CommandButton Command5 
  227.          Caption         =   "NLST"
  228.          Height          =   255
  229.          Left            =   2640
  230.          TabIndex        =   23
  231.          Top             =   1800
  232.          Width           =   735
  233.       End
  234.       Begin CommandButton Command4 
  235.          Caption         =   "LIST"
  236.          Height          =   255
  237.          Left            =   2640
  238.          TabIndex        =   22
  239.          Top             =   1440
  240.          Width           =   735
  241.       End
  242.       Begin TextBox PathName 
  243.          Height          =   375
  244.          Left            =   1440
  245.          TabIndex        =   21
  246.          Text            =   "test.ftp"
  247.          Top             =   360
  248.          Width           =   1695
  249.       End
  250.       Begin Label Label7 
  251.          Caption         =   "LocalName"
  252.          Height          =   255
  253.          Left            =   120
  254.          TabIndex        =   29
  255.          Top             =   840
  256.          Width           =   975
  257.       End
  258.       Begin Label Label6 
  259.          Caption         =   "RemoteName"
  260.          Height          =   255
  261.          Left            =   120
  262.          TabIndex        =   20
  263.          Top             =   360
  264.          Width           =   1215
  265.       End
  266.    End
  267.    Begin TextBox User 
  268.       Height          =   285
  269.       Left            =   1200
  270.       TabIndex        =   5
  271.       Text            =   "Name"
  272.       Top             =   840
  273.       Width           =   1095
  274.    End
  275.    Begin TextBox Host 
  276.       Height          =   285
  277.       Left            =   1200
  278.       TabIndex        =   4
  279.       Text            =   "Name"
  280.       Top             =   480
  281.       Width           =   1095
  282.    End
  283.    Begin CommandButton Abort 
  284.       Caption         =   "Abort"
  285.       Height          =   255
  286.       Left            =   2400
  287.       TabIndex        =   11
  288.       Top             =   1080
  289.       Width           =   855
  290.    End
  291.    Begin CommandButton Command2 
  292.       Caption         =   "Logout"
  293.       Height          =   255
  294.       Left            =   2400
  295.       TabIndex        =   10
  296.       Top             =   1440
  297.       Width           =   855
  298.    End
  299.    Begin CommandButton Command1 
  300.       Caption         =   "Login"
  301.       Height          =   255
  302.       Left            =   2400
  303.       TabIndex        =   9
  304.       Top             =   360
  305.       Width           =   855
  306.    End
  307.    Begin TextBox Acct 
  308.       Height          =   285
  309.       Left            =   1200
  310.       TabIndex        =   7
  311.       Text            =   "Name"
  312.       Top             =   1560
  313.       Width           =   1095
  314.    End
  315.    Begin TextBox Pass 
  316.       Height          =   285
  317.       Left            =   1200
  318.       TabIndex        =   6
  319.       Text            =   "*******"
  320.       Top             =   1200
  321.       Width           =   1095
  322.    End
  323.    Begin CommandButton Command3 
  324.       Caption         =   "Clear"
  325.       Height          =   255
  326.       Left            =   6600
  327.       TabIndex        =   14
  328.       Top             =   120
  329.       Width           =   735
  330.    End
  331.    Begin PowerTCP_FTP FTP1 
  332.       Flags           =   8
  333.       Left            =   6000
  334.       OemLicense      =   ""
  335.       Top             =   0
  336.    End
  337.    Begin Frame Frame1 
  338.       BackColor       =   &H00FFFFFF&
  339.       Caption         =   "Login/Logout"
  340.       ClipControls    =   0   'False
  341.       Height          =   2055
  342.       Left            =   120
  343.       TabIndex        =   0
  344.       Top             =   120
  345.       Width           =   3255
  346.       Begin CommandButton Command14 
  347.          Caption         =   "Kill"
  348.          Height          =   255
  349.          Left            =   2280
  350.          TabIndex        =   31
  351.          Top             =   1680
  352.          Width           =   855
  353.       End
  354.       Begin CommandButton Command11 
  355.          Caption         =   "Rein"
  356.          Height          =   255
  357.          Left            =   2280
  358.          TabIndex        =   26
  359.          Top             =   600
  360.          Width           =   855
  361.       End
  362.       Begin Label Label5 
  363.          Caption         =   "Account"
  364.          Height          =   255
  365.          Left            =   120
  366.          TabIndex        =   18
  367.          Top             =   1440
  368.          Width           =   735
  369.       End
  370.       Begin Label Label4 
  371.          Caption         =   "Password"
  372.          Height          =   255
  373.          Left            =   120
  374.          TabIndex        =   17
  375.          Top             =   1080
  376.          Width           =   855
  377.       End
  378.       Begin Label Label3 
  379.          Caption         =   "User"
  380.          Height          =   255
  381.          Left            =   120
  382.          TabIndex        =   16
  383.          Top             =   720
  384.          Width           =   615
  385.       End
  386.       Begin Label Label1 
  387.          Caption         =   "Host"
  388.          Height          =   255
  389.          Left            =   120
  390.          TabIndex        =   15
  391.          Top             =   360
  392.          Width           =   615
  393.       End
  394.    End
  395.    Begin Label Label2 
  396.       Caption         =   "Log"
  397.       Height          =   255
  398.       Index           =   1
  399.       Left            =   4680
  400.       TabIndex        =   33
  401.       Top             =   120
  402.       Width           =   495
  403.    End
  404.    Begin Label Status1 
  405.       BackColor       =   &H00C0C0C0&
  406.       Height          =   375
  407.       Left            =   0
  408.       TabIndex        =   13
  409.       Top             =   6360
  410.       Width           =   4815
  411.    End
  412.    Begin Label Label2 
  413.       Caption         =   "Replies"
  414.       Height          =   255
  415.       Index           =   0
  416.       Left            =   7560
  417.       TabIndex        =   12
  418.       Top             =   120
  419.       Width           =   735
  420.    End
  421. End
  422. Dim FileNum As Integer  ' local to form
  423.  
  424. Sub Abort_Click ()
  425.     FTP1.Abort = True
  426. End Sub
  427.  
  428. Sub Cle_Click ()
  429.     Text3 = ""
  430. End Sub
  431.  
  432. Sub Command1_Click ()
  433.     Text1 = ""
  434.     Text3 = ""
  435.     FTP1.User = User
  436.     FTP1.Password = Pass
  437.     FTP1.Account = Acct
  438.     FTP1.LoginHost = Host
  439. End Sub
  440.  
  441. Sub Command10_Click ()
  442.     FTP1.PrintWorkingDir = True
  443. End Sub
  444.  
  445. Sub Command11_Click ()
  446.     FTP1.Reinitialize = True
  447. End Sub
  448.  
  449. Sub Command12_Click ()
  450.     FTP1.Type = "I"
  451. End Sub
  452.  
  453. Sub Command13_Click ()
  454.     FTP1.Type = "A"
  455. End Sub
  456.  
  457. Sub Command14_Click ()
  458.     FTP1.CloseControl = True
  459. End Sub
  460.  
  461. Sub Command15_Click ()
  462.     FTP1.Allocate = FileSize
  463. End Sub
  464.  
  465. Sub Command16_Click ()
  466.     FTP1.ChDir = PathName
  467. End Sub
  468.  
  469. Sub Command17_Click ()
  470.     FTP1.ChDirUp = True
  471. End Sub
  472.  
  473. Sub Command18_Click ()
  474.     FTP1.Command = CommandStr
  475. End Sub
  476.  
  477. Sub Command19_Click ()
  478.     FTP1.Dele = PathName
  479. End Sub
  480.  
  481. Sub Command2_Click ()
  482.     FTP1.Logout = True
  483. End Sub
  484.  
  485. Sub Command20_Click ()
  486.     FTP1.MakeDir = PathName
  487. End Sub
  488.  
  489. Sub Command21_Click ()
  490.     FTP1.RemoveDir = PathName
  491. End Sub
  492.  
  493. Sub Command22_Click ()
  494.     FTP1.Restart = CommandStr
  495. End Sub
  496.  
  497. Sub Command23_Click ()
  498.     FTP1.Status = CommandStr
  499. End Sub
  500.  
  501. Sub Command24_Click ()
  502.     FTP1.System = True
  503.  
  504. End Sub
  505.  
  506. Sub Command25_Click ()
  507.     FTP1.Rename = PathName
  508. End Sub
  509.  
  510. Sub Command3_Click ()
  511.     Text1 = ""
  512. End Sub
  513.  
  514. Sub Command4_Click ()
  515.     Text2.Text = ""
  516.     FileNum = 0
  517.     FTP1.List = PathName
  518. End Sub
  519.  
  520. Sub Command5_Click ()
  521.     Text2.Text = ""
  522.     FTP1.NameList = PathName
  523. End Sub
  524.  
  525. Sub Command6_Click ()
  526.     Text2.Text = ""
  527.     FileNum = 2' read data from file
  528.     'FileNum = 10 'put in bit bucket
  529.     Open LocalName For Binary Access Read As #2
  530.     FTP1.Store = PathName
  531. End Sub
  532.  
  533. Sub Command7_Click ()
  534.     Text2.Text = ""
  535.     FileNum = 2' read data from file
  536.     'FileNum = 10 'put in bit bucket
  537.     Open LocalName For Binary Access Read As #2
  538.     FTP1.StoreUnique = PathName
  539. End Sub
  540.  
  541. Sub Command8_Click ()
  542.     Text2.Text = ""
  543.     FileNum = 2' read data from file
  544.     'FileNum = 10 'put in bit bucket
  545.     Open LocalName For Binary Access Read As #2
  546.     FTP1.Appe = PathName
  547. End Sub
  548.  
  549. Sub Command9_Click ()
  550.     Text2.Text = ""
  551.     FileNum = 1' save data to file
  552.     'FileNum = 2 'put in bit bucket
  553.     Open LocalName For Output As #1
  554.     FTP1.Retrieve = PathName
  555. End Sub
  556.  
  557. Sub Form_Load ()
  558.     FileNum = 0
  559.     FTP1.User = User
  560.     FTP1.Password = Pass
  561.     FTP1.Account = Acct
  562.     'FTP1.LoginHost = Host
  563. End Sub
  564.  
  565. Sub Form_Unload (Cancel As Integer)
  566.     End
  567. End Sub
  568.  
  569. Sub FTP1_Log (Message As String)
  570.     Text3 = Text3 & Message & Chr$(13) & Chr$(10)
  571. End Sub
  572.  
  573. Sub FTP1_Recv (RecvData As String)
  574.     Select Case FileNum
  575.     Case 0
  576.         ' put data to edit box: list or name list
  577.         Text2 = Text2 & RecvData
  578.     Case 1
  579.         ' put data into open file
  580.         If RecvData = "" Then
  581.             Close #1
  582.             FileNum = 0
  583.         Else
  584.             Print #1, RecvData;
  585.         End If
  586.     End Select
  587. End Sub
  588.  
  589. Sub FTP1_Reply (Status As Integer, LastCommand As Integer, Code As Integer, Reply As String)
  590.     Text1 = Text1 & Reply & Chr$(13) & Chr$(10)
  591.     Select Case (Status)
  592.     Case FTP_UNKNOWN    ' spontaneous data or reply from Command
  593.         Status1 = "Unknown"
  594.     Case FTP_SUCCESS    ' operation completed sucessfully
  595.         Status1 = "Success"
  596.         'If Code = 226 And FileNum = 1 Then
  597.             ' file transfer successful
  598.             'Close #FileNum
  599.             'FileNum = 0
  600.         'End If
  601.     Case FTP_ERROR      ' unexpected error
  602.         Status1 = "Error"
  603.         If FileNum = 1 Then
  604.             Close #1
  605.             FileNum = 0
  606.         End If
  607.     Case FTP_FAILURE    ' failure to complete successfully
  608.         Status1 = "Failure"
  609.         If FileNum = 1 Then
  610.             Close #1
  611.             FileNum = 0
  612.         End If
  613.     Case FTP_WORKING    ' informative...wait for next
  614.         Status1 = "Working"
  615.     End Select
  616. End Sub
  617.  
  618. Sub FTP1_Send (Tag As Long)
  619.     ' get data from open file
  620.     Location = Loc(2)
  621.     LengthOfFile = LOF(2)
  622.     Transfer = LengthOfFile - Location
  623.     If Transfer > 12000 Then Transfer = 12000
  624.     If Transfer > 0 Then
  625.         FTP1.Send = Input$(Transfer, #2)
  626.     Else
  627.         FTP1.CloseData = True
  628.         Close #2
  629.         FileNum = 0
  630.     End If
  631. End Sub
  632.  
  633.